package com.joplus.housekeeper.adapter;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;

import com.bigkoo.convenientbanner.holder.Holder;
import com.nostra13.universalimageloader.core.ImageLoader;

/**
 * Created by Administrator on 2016/6/26.
 */
public class BannerHotelViewHold implements Holder<String> {

    private ImageView imageView;

    @Override
    public void UpdateUI(Context context, int position,String data) {
        //imageView.setImageResource(R.drawable.jo_app_guide1);
        imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
        ImageLoader.getInstance().displayImage(data,imageView);

    }

    @Override
    public View createView(Context context) {
//        imageView = new ImageView(context);
//        imageView.setScaleType(ImageView.ScaleType.FIT_XY);
        return getImageView(context);
    }

    private ImageView getImageView(Context context){
        if(imageView!=null){
            return imageView;
        }else{
            imageView = new ImageView(context);
            imageView.setScaleType(ImageView.ScaleType.FIT_XY);
            return imageView;
        }
    }

}
